package com.masterclient.app.widget;

import android.widget.TextView;

import com.eoner.baselibrary.utils.TimeUtil;

import io.reactivex.functions.Consumer;

/**
 * 作者：sean
 * 创建时间：2018/4/8 17:34
 * 功能说明：
 */
public class TextConsumer implements Consumer<Long> {
    TextView tvRemain;
    long amount;
    public TextConsumer(long amount,TextView tvRemain) {
        this.tvRemain = tvRemain;
        this.amount = amount;
    }
    @Override
    public void accept(Long t) throws Exception {
        String time = TimeUtil.getTimeString(amount-t);
        tvRemain.setText("剩余" + time);
    }
}
